window.onload = function () {

    initSltCity();
    // document.getElementById('sltCity').onchange = setAreas;
    initSltNation();

    initSltSchool();
}

function initSltCity() {

    var sltCity = document.getElementById('sltCity');
    sltCity.innerHTML = "";

    for (var key in city) {

        var opt = document.createElement('option');
        opt.value = city[key].id;
        opt.innerText = city[key].name;

        sltCity.appendChild(opt)
    }

}

function initSltNation() {

    var sltNation = document.getElementById('sltNation');
    sltNation.innerHTML = "";

    for (var key in nation) {

        var opt = document.createElement('option');
        opt.value = nation[key].id;
        opt.innerText = nation[key].name;

        sltNation.appendChild(opt)
    }

}


function initSltSchool() {

    var sltSchool = document.getElementById('sltSchool');
    sltSchool.innerHTML = "";

    for (var key in school) {

        var opt = document.createElement('option');
        opt.value = school[key].id;
        opt.innerText = school[key].name;

        sltSchool.appendChild(opt)
    }

}